from PyQt4 import QtGui, QtCore
import osg2
import lucid.core
import lucid.core.plugin_interfaces
from pydispatch import dispatcher

class BoxCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create box.  """
   def __init__(self):
      super(BoxCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Box"
   
   @staticmethod
   def createGraph():
      return osg2.makeBox(1.0,1.0,1.0,
                          1,1,1)

class PlaneCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create plane.  """
   def __init__(self):
      super(PlaneCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Plane"
   
   @staticmethod
   def createGraph():
      return osg2.makePlane(1.0, 1.0, 40, 40)

class ConeCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create cone.  """
   def __init__(self):
      super(ConeCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Cone"
   
   @staticmethod
   def createGraph():
      return osg2.makeCone(1,1,10,True,True)


class CylinderCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create cylinder.  """
   def __init__(self):
      super(CylinderCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Cylinder"
   
   @staticmethod
   def createGraph():
      return osg2.makeCylinder(1.0, 1.0, 10,
                               True,True,True)

class TorusCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create torus.  """
   def __init__(self):
      super(TorusCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Torus"
   
   @staticmethod
   def createGraph():
      return osg2.makeTorus(1.0,2.0,20,20)


class SphereCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create sphere.  """
   def __init__(self):
      super(SphereCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Sphere"
   
   @staticmethod
   def createGraph():
      return osg2.makeSphere(10,1)
   

class LatLongSphereCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create ll sphere.  """
   def __init__(self):
      super(LatLongSphereCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Sphere (Lat/Long)"
   
   @staticmethod
   def createGraph():
      return osg2.makeLatLongSphere(10,10,1.0)


class ConicalFrustumCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create frustum.  """
   def __init__(self):
      super(ConicalFrustumCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Conical Frustum"
   
   @staticmethod
   def createGraph():
      return osg2.makeConicalFrustum(1.0,1.0,1.0,4,
                                     True,True,True)


class TeapotCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create frustum.  """
   def __init__(self):
      super(TeapotCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Teapot"
   
   @staticmethod
   def createGraph():
      return osg2.makeTeapot(5)

   
   
